#include <iostream>
#include <signal.h>
#include <unistd.h>

void hander(int sig)
{
    std::cout<<"get a sig:"<<sig<<std::endl;
}
int main()
{
    signal(2,hander);
    while(true)
    {
        std::cout<<"i am process:"<<getpid()<<std::endl;
        sleep(1);
    }
}